from common import pagedriver
from page.HomePage import HomePage
from page.LoginPage import LoginPage
from page.LoginandRegisterPage import LoginandRegisterPage
from page.MyPage import MyPage
from page.verifyPage import verifyPage
from page.RegisterPage import registerPage
class Register():
    def register(self,casename,address,asserts,n):
        print(casename)
        HomePage().disallow_click()  # 点击“不允许”
        HomePage().my_click()  # 点击“我的”
        MyPage().loginandRegister_click()  # 点击“注册/登录”
        LoginPage().register_click()#点击“注册选项”
        registerPage().address_input(address)
        try:
            registerPage().centainly_click()
        except:
            pass
        try:
            verifyPage().verify_register_click()
        except:
            pass
        if n==1:
            try:
                pagedriver.locater_Xpath(asserts)
                bool=True
            except:
                bool=False
        else:
            try:
                pagedriver.locater_Xpath(asserts)
                bool = True
            except:
                bool = False
        return bool